package com.ruoyi.find.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.find.domain.SysUser;
import com.ruoyi.find.service.SysUserService;
import com.ruoyi.find.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/users")
public class UserController {

    @Autowired
    private SysUserService userService;

    @PostMapping("/getphonecode")
    public R getphonecode(@Validated @RequestBody LoginVo loginVo){
        return userService.getphonecode(loginVo);
    }


    @PostMapping("/getphonelogin")
    public R  getphonelogin(@Validated @RequestBody LoginVo loginVo){
        return userService.getphonelogin(loginVo);
    }

    @PostMapping("/getadduser")
    public R getadduser(@Validated @RequestBody SysUser sysUser){
        return userService.getadduser(sysUser);
    }

}
